#include <QCoreApplication>
#include <QFile>
#include <QDebug>
#include <QTextCodec>
#include <QCryptographicHash>

void open_file()
{
	QFile file("D:/code/qt/FileCheck/poetry.txt");
	if(file.open(QIODevice::ReadOnly))
	{
		QByteArray content = file.readAll();
		//转码
		QString text = QTextCodec::codecForName("UTF-8")->toUnicode(content);
		qDebug() << text;
		qDebug() << QCryptographicHash::hash(content,QCryptographicHash::Md5).toHex();
		file.close();
	}
}
int main(int argc, char *argv[])
{
	QCoreApplication a(argc, argv);
	open_file();
	return a.exec();
}
